home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2004 #2 / K-CD-2-2004.ISO / OpenOffice Sv / f_0397 / python-core-2.2.2 / lib / encodings / aliases.py < prev    next >
Encoding:
Python Source  |  2003-07-18  |  2.7 KB  |  116 lines

  1. """ Encoding Aliases Support
  2.  
  3.     This module is used by the encodings package search function to
  4.     map encodings names to module names.
  5.  
  6.     Note that the search function converts the encoding names to lower
  7.     case and replaces hyphens with underscores *before* performing the
  8.     lookup.
  9.  
  10. """
  11. aliases = {
  12.  
  13.     # Latin-1
  14.     'latin': 'latin_1',
  15.     'latin1': 'latin_1',
  16.     
  17.     # UTF-7
  18.     'utf7': 'utf_7',
  19.     'u7': 'utf_7',
  20.     
  21.     # UTF-8
  22.     'utf': 'utf_8',
  23.     'utf8': 'utf_8',
  24.     'u8': 'utf_8',
  25.     'utf8@ucs2': 'utf_8',
  26.     'utf8@ucs4': 'utf_8',
  27.     
  28.     # UTF-16
  29.     'utf16': 'utf_16',
  30.     'u16': 'utf_16',
  31.     'utf_16be': 'utf_16_be',
  32.     'utf_16le': 'utf_16_le',
  33.     'unicodebigunmarked': 'utf_16_be',
  34.     'unicodelittleunmarked': 'utf_16_le',
  35.  
  36.     # ASCII
  37.     'us_ascii': 'ascii',
  38.     'ansi_x3.4_1968': 'ascii', # used on Linux
  39.     'ansi_x3_4_1968': 'ascii', # used on BSD?
  40.     '646': 'ascii',            # used on Solaris
  41.  
  42.     # EBCDIC
  43.     'ebcdic_cp_us': 'cp037',
  44.     'ibm039': 'cp037',
  45.     'ibm1140': 'cp1140',
  46.     
  47.     # ISO
  48.     '8859': 'latin_1',
  49.     'iso8859': 'latin_1',
  50.     'iso8859_1': 'latin_1',
  51.     'iso_8859_1': 'latin_1',
  52.     'iso_8859_10': 'iso8859_10',
  53.     'iso_8859_13': 'iso8859_13',
  54.     'iso_8859_14': 'iso8859_14',
  55.     'iso_8859_15': 'iso8859_15',
  56.     'iso_8859_2': 'iso8859_2',
  57.     'iso_8859_3': 'iso8859_3',
  58.     'iso_8859_4': 'iso8859_4',
  59.     'iso_8859_5': 'iso8859_5',
  60.     'iso_8859_6': 'iso8859_6',
  61.     'iso_8859_7': 'iso8859_7',
  62.     'iso_8859_8': 'iso8859_8',
  63.     'iso_8859_9': 'iso8859_9',
  64.  
  65.     # Mac
  66.     'maclatin2': 'mac_latin2',
  67.     'maccentraleurope': 'mac_latin2',
  68.     'maccyrillic': 'mac_cyrillic',
  69.     'macgreek': 'mac_greek',
  70.     'maciceland': 'mac_iceland',
  71.     'macroman': 'mac_roman',
  72.     'macturkish': 'mac_turkish',
  73.  
  74.     # Windows
  75.     'windows_1251': 'cp1251',
  76.     'windows_1252': 'cp1252',
  77.     'windows_1254': 'cp1254',
  78.     'windows_1255': 'cp1255',
  79.     'windows_1256': 'cp1256',
  80.     'windows_1257': 'cp1257',
  81.     'windows_1258': 'cp1258',
  82.  
  83.     # MBCS
  84.     'dbcs': 'mbcs',
  85.  
  86.     # Code pages
  87.     '437': 'cp437',
  88.  
  89.     # CJK
  90.     #
  91.     # The codecs for these encodings are not distributed with the
  92.     # Python core, but are included here for reference, since the
  93.     # locale module relies on having these aliases available.
  94.     #
  95.     'jis_7': 'jis_7',
  96.     'iso_2022_jp': 'jis_7',
  97.     'ujis': 'euc_jp',
  98.     'ajec': 'euc_jp',
  99.     'eucjp': 'euc_jp',
  100.     'tis260': 'tactis',
  101.     'sjis': 'shift_jis',
  102.  
  103.     # Content transfer/compression encodings
  104.     'rot13': 'rot_13',
  105.     'base64': 'base64_codec',
  106.     'base_64': 'base64_codec',
  107.     'zlib': 'zlib_codec',
  108.     'zip': 'zlib_codec',
  109.     'hex': 'hex_codec',
  110.     'uu': 'uu_codec',
  111.     'quopri': 'quopri_codec',
  112.     'quotedprintable': 'quopri_codec',
  113.     'quoted_printable': 'quopri_codec',
  114.  
  115. }
  116.